home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #23 (1994-02-10)(Diesel)(DE)[WB].zip / Purity #23 (1994-02-10)(Diesel)(DE)[WB].adf / DesignerDemo / allkindsdemo / AllKindsDemo.c < prev    next >
C/C++ Source or Header  |  1994-01-20  |  1KB  |  55 lines

  1. /* Simple demo using a Designer created file */
  2. /* Only run from CLI */
  3.  
  4. #include <allkindsdemowin.c>
  5.  
  6. void main(void)
  7. {
  8. int done=0;
  9. ULONG class;
  10. UWORD code;
  11. struct Gadget *pgsel;
  12. struct IntuiMessage *imsg;
  13. if (OpenLibs()==0)
  14.     {
  15.     if (MakeImages()==0)
  16.         {
  17.         if (OpenWindowDisplayWindow()==0)
  18.             {
  19.             while (done==0)
  20.                 {
  21.                 Wait(1L << DisplayWindow->UserPort->mp_SigBit);
  22.                 imsg=GT_GetIMsg(DisplayWindow->UserPort);
  23.                 while (imsg != NULL )
  24.                     {
  25.                     class=imsg->Class;
  26.                     code=imsg->Code;
  27.                     pgsel=(struct Gadget *)imsg->IAddress; /* Only reference if it is a gadget message */
  28.                     GT_ReplyIMsg(imsg);
  29.                     switch (class)
  30.                         {
  31.                         case IDCMP_CLOSEWINDOW :
  32.                             done=1;
  33.                             break;
  34.                         case IDCMP_REFRESHWINDOW :
  35.                             GT_BeginRefresh(DisplayWindow);
  36.                             RendWindowDisplayWindow();
  37.                             GT_EndRefresh( DisplayWindow, TRUE);
  38.                             break;
  39.                         };
  40.                     imsg=GT_GetIMsg(DisplayWindow->UserPort);
  41.                     }
  42.                 }
  43.             CloseWindowDisplayWindow();
  44.             }
  45.         else
  46.             printf("Cannot open window.\n");
  47.         FreeImages();
  48.         }
  49.     else
  50.         printf("Cannot make images.\n");
  51.     }
  52. else
  53.     printf("Cannot open libraries.\n");
  54. }
  55.